package modelLayer;

public class Subject {
	private String name;
	private int ID;
	private Teacher teacher;
	private Class cl;
	private TeachingBlock tb;
	
	public Subject(){
		
	}
	
	public Subject(String name){
		setName(name);
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getID() {
		return ID;
	}

	public void setID(int iD) {
		ID = iD;
	}

	public Teacher getTeacher() {
		return teacher;
	}

	public void setTeacher(Teacher teacher) {
		this.teacher = teacher;
	}

	@Override
	public String toString() {
		return "Subject [name=" + name + ", ID=" + ID + "]";
	}

	
	/*public String toString() {
		return "Subject ID, Name, Teacher, Class and TeachingBlock: "
					+ ID + name + (teacher.getName()) + (cl.getClassName()) + (tb.getID());
	}*/
	
	
	@Override
	public boolean equals(Object obj) {
		boolean isEqual = false;
		
		if (obj == null){
			isEqual = false;
		}
			
		if (!(obj instanceof Subject)){
			isEqual = false;
		}
		
		Subject other = (Subject) obj;
		if (this.getName() != null && this.getName().equals(other.getName())){
			isEqual = true;
		}
		
		return isEqual;
	}
	
}
